package com;



import java.io.File;
import java.io.InputStream;
import java.lang.reflect.Field;
import java.net.HttpURLConnection;
import java.net.URL;
import java.sql.Timestamp;
import java.text.SimpleDateFormat;
import java.util.*;
import java.util.concurrent.*;

/**
 * @ClassName: Demo
 * @Author: ZhangYue26
 * @Description:
 * @Date: 2020-08-07
 */
public class Demo {
    public static void main(String[] args) throws Exception {
//        BlockingDeque<Runnable> blockingDeque = new LinkedBlockingDeque<>(100);
//        blockingDeque.add(() -> {
//            for (int i = 0; i < 100000; i += 2) {
//                System.out.println(i + "偶数");
//            }
//        });
//        blockingDeque.add(() -> {
//            for (int i = 0; i < 100000; i++) {
//                System.out.println(i + "奇数");
//            }
//        });
//        Executor executor = new ThreadPoolExecutor(10,15,1000,TimeUnit.SECONDS,blockingDeque);
//        executor.execute(blockingDeque.takeFirst());
//        executor.execute(blockingDeque.takeFirst());
//
//        ScheduledThreadPoolExecutor scheduledThreadPoolExecutor = new ScheduledThreadPoolExecutor(10);
//        scheduledThreadPoolExecutor.schedule(() -> {
//            System.out.println("你好!!!!!!");
//        }, 1, TimeUnit.SECONDS);
//        scheduledThreadPoolExecutor.schedule(() -> {
//            System.out.println("string");
//            return "成功";
//        },1000l,TimeUnit.SECONDS);
//        scheduledThreadPoolExecutor.shutdown();
//
//
//        SimpleDateFormat simpleDateFormat = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS+08:00");
//        SimpleDateFormat simpleDateFormat1 = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSS+08:00");
//        Date parse1 = simpleDateFormat.parse("2020-11-05T00:00:00.000+08:00");
//        Date parse2 = simpleDateFormat1.parse("2020-10-27T00:00:00.000+08:00");
//        System.out.println(parse1.getTime());
//        System.out.println(parse2.getTime());
//
//        System.out.println(simpleDateFormat1.format(new Date(1493067513930l)));
//
//        List<String> list = new ArrayList(){{add("123");add("234");
//        }};
//
//        list = list.subList(0, 2);
//        System.out.println(list);
        test();
//        System.out.println("test");
        System.out.println(UUID.randomUUID().toString().replaceAll("-",""));

    }

    public static void test(){
        try {
            throw new NumberFormatException();
        } catch (Exception e) {
            System.out.println("出现异常");
        }
    }


}
